/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lojavirtual.servlets;

import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lojavirtual.persistence.CategoriaDAO;

/**
 *
 * @author 711034
 */
public class ListarCategoriaServlet extends HttpServlet {

    private CategoriaDAO categoriaDAO = new CategoriaDAO();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.getSession().setAttribute("categorias", categoriaDAO.listarCategorias());
        resp.sendRedirect("/LojaVirtual/listar/categoria.jsp");
    }
    
}
